<!-- 整改报告 -->
<template>
  <a-spin tip="正在导出,请等待..." size="large" :spinning="loading" style="font-size: 18px">
    <div class="lanjian-content pdd">
       <a-tabs v-model="activeKey" type='editable-card' border="false" hide-add
               foldbtn="false">
        <a-tab-pane key="1" tab="整改报告" :closable="false">
        </a-tab-pane>
         <a-tab-pane key="3" tab="评估情况" :closable="false">
         </a-tab-pane>
        <a-tab-pane key="2" tab="提交审批记录" :closable="false">
        </a-tab-pane>
<!--         <a-button v-show="activeKey === '1'"  slot="tabBarExtraContent" type="primary" style="margin-right: 10px" @click="save">
           保存
         </a-button>-->
         <a-button slot="tabBarExtraContent" type="primary" @click="exportFile" title="导出提报">
           <span class='icon iconfont'>&#xe6bf;</span>
         </a-button>
      </a-tabs>
      <div v-if="activeKey == '1'" class="tabs-content">
        <adetails  ref="info"></adetails>
        <!-- <rectification-report></rectification-report> -->
      </div>
       <div v-if="activeKey == '2'" class="tabs-content">
         <ApprovalHistory :data-source="[]"></ApprovalHistory>
      </div>
      <div v-if="activeKey === '3'" class="tabs-content">
        <Status ref="Status"></Status>
      </div>
    </div>
  </a-spin>
</template>

<script>
import adetails from './adetails'
import RectificationReport from './RectificationReport'
import ApprovalHistory from './ApprovalHistory';
import {getNowMilliSecond, getSystemDir} from "@/utils/common";
import {exportModule, mkdir, setReportExtime} from "@/utils/fileUtils";
import fs from "fs";
import {getJLID} from "@/utils/JsonTools";
import Status from './Status.vue';
export default {
  name: 'index',
	components:{
    Status,
		adetails, RectificationReport,ApprovalHistory
	},
  data () {
    return {
      loading:false,
      m_status:"",
      activeKey: '1'
    }
  },
  mounted () {
  },
  methods: {
    exportFile() {
      this.loading=true
      let foldid=getNowMilliSecond()
      let dir=getSystemDir()
      console.log("pp--s--",dir)
      mkdir(dir)
      mkdir(dir+"\\"+foldid)
      exportModule(4,dir+"\\"+foldid).then(res=>{
        this.loading=false
        if(res==0){
          this.$message.error('导出失败')
          return
        }
        if(res==1){
          setReportExtime()
          this.$message.success('导出成功')
          return
        }
        this.$message.warn('未完成数据填报，无法导出提报')
      })
    },
    save(){
      this.$refs.info.save()
    }
  }
}
</script>
<style lang="less" scoped>
/deep/ .ant-tabs-nav-scroll {
  float: left;
}
</style>
<style lang="scss" >
// 滚动条背景颜色
.ant-table-body::-webkit-scrollbar,
.info::-webkit-scrollbar {
  height: 9px;
  width: 9px;
  background-color: #fcfcfc;
}
.w260{
  width:260px
}
// 滚动条颜色
.ant-table-body::-webkit-scrollbar-thumb,
.info::-webkit-scrollbar-thumb {
  border-radius: 9px;
  background-color: #cccccc;
}

</style>
